<template>
  <div class="homeView">

    <noticeSwiper class="noticeSwiper"></noticeSwiper>
    <noticetextswiper></noticetextswiper>
    <nftshow :hot-item-name="hotItemName" :hot-item-url="hotItemUrl" :HotItemAuthor="hotItemAuthor"
      :HotItemPrice="hotItemPrice" :HotItemIntroduce="hotItemIntroduce" :hot-item-id="hotItemId" :hot-item-numbering="hotItemNumbering">
    </nftshow>
    <homegrid></homegrid>
    <instructornft class="instructornft"></instructornft>


  </div>
</template>

<script>

import noticeSwiper from '@/components/NoticeSwiper.vue'
import noticetextswiper from '@/components/NoticeTextSwiper.vue'
import nftshow from '@/components/NftShow.vue'
import homegrid from '@/components/HomeGrid.vue'
import instructornft from '@/components/InstructorNft.vue'
import zfooter from '@/components/ZFooter.vue'
export default {
  name: "NavLinkView",
  data() {
    return {
      // footerWidth: '900px',
      hotItemUrl: "",
      hotItemName: "",
      hotItemAuthor: "",
      hotItemPrice: "",
      hotItemIntroduce: "",
      hotItemNumbering: "",
      hotItemId:"",
      moreItems: []
    };
  },
  components: { noticeSwiper, noticetextswiper, nftshow, homegrid, instructornft, zfooter },
  methods: {
    getItem() {
      let hotItemsToken = this.$axios.postInfo("/itemGroup", { groupState: 5 })
      hotItemsToken.then((res => {
        console.log(res.items)
        let item = res.itemGroups.sort((a, b) => {
          return b.sort - a.sort
        })
        let getitem = res.items.filter(index => {
          return index.group == res.itemGroups[0].id
        })
        console.log(getitem)
        this.hotItemName = item[0].name
        this.hotItemUrl = item[0].url
        this.hotItemAuthor = item[0].author
        this.hotItemPrice = getitem[0].price == 0 ? item[0].iprice : getitem[0].price
        console.log(this.hotItemPrice)
        this.hotItemIntroduce = item[0].introduce
        this.hotItemNumbering = getitem[0].numBerIng
        this.hotItemId=getitem[0].group
        console.log(item)
      }))
    },

  },
  mounted() {


  },
  created(){
    this.getItem()
  }

}

</script>
<style  lang="less" scoped>
* {
  margin: 0%;
  padding: 0%;
}

.homeView {
  width: 100%;
  min-width: 900px;
  background: rgba(219, 228, 246, 0.3);

  .navlink {
    top: 0%;
    position: fixed;
    // background: #fff;
    z-index: 999;

  }

  .noticeSwiper {
    margin-top: 70px;
  }

  .instructornft {
    margin-top: 100px;
  }

  footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;

  }
}
</style>